package cn.edu.nju.software.service.intf;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import cn.edu.nju.software.bean.show.BookItemInOrder;
import cn.edu.nju.software.bean.show.OrderSearchListItem;
import cn.edu.nju.software.bean.storage.Order;
import cn.edu.nju.software.bean.storage.User;

public interface OrderService {
	/**
	 * 根据订单ID取得订单
	 */
	public abstract Order getOrderById(int id) throws SQLException;
	
	/**
	 * 根据指定条件搜索订单
	 */
	public abstract List<OrderSearchListItem> searchOrders(int id, String user, int status, Date beginDate, Date endDate, 
			String bookTitle) throws SQLException;
	
	/**
	 * 修改订单状态
	 */
	public abstract boolean modifyOrderStatus(int orderID, int operateCode) throws SQLException;
	
	/**
	 * 取得订单中的书籍
	 */
	public abstract List<BookItemInOrder> getOrderBooks(int id) throws SQLException;
	
	/**
	 * 根据用户ID取得用户
	 */
	public abstract User getUsersByID(int userID) throws SQLException;
}
